﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
using MySSO.Core.Entity;

namespace MySSO.Core.Repository
{
    public class AdminUserLoginLogRepository : BaseRepository
    {
        public long InsertAdminUserLoginLogEntity(AdminUserLoginLogEntity entity)
        {
            long ID = 0;
            if (entity == null)
            {
                return ID;
            }
            string sql = @"INSERT INTO uc_AdminUserLoginLog([AUID],[Name],[LoginDate],[IP],[LoginArea],[ClientInfo],[Success],[ErrMessage],[RID])
                          VALUES (@AUID,@Name,@LoginDate,@IP,@LoginArea,@ClientInfo,@Success,@ErrMessage,@RID);SELECT @@IDENTITY;";
            using (var connection = GetConnection())
            {
                ID = connection.ExecuteScalar<long>(sql, entity);
            }
            return ID;
        }
    }
}
